﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Public;
using BLL;

namespace QLNhanKhau
{
    public partial class frmMain : DevComponents.DotNetBar.Metro.MetroForm
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            // Gán DataSource bằng cách gọi phương thức tĩnh của lớp Business
            //dgvTonGiao.DataSource = TonGiaoBLL.getTonGiao();
            //labXinChao.Text=NguoiDungBLL.LoadHoTen()
            labXinChao.Text = frmDangNhap.user_login.HoTen;
        }

        private void ItemKhaiSinh_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmKhaiSinh ks = new frmKhaiSinh();
            ks.MdiParent = this;
            ks.StartPosition = FormStartPosition.CenterScreen;
            ks.Show();

        }

        private void ItemChuyenDen_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmChuyenDen cd = new frmChuyenDen();
            cd.MdiParent = this;
            cd.StartPosition = FormStartPosition.CenterScreen;
            cd.Show();

        }

        private void ItemTrongXa_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmChuyenDi cdi = new frmChuyenDi();
            cdi.MdiParent = this;
            cdi.StartPosition = FormStartPosition.CenterScreen;
            cdi.Show();

        }

        private void ItemKhaiTu_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmKhaiTu tt = new frmKhaiTu();
            tt.MdiParent = this;
            tt.StartPosition = FormStartPosition.CenterScreen;
            tt.Show();

        }

        private void ItemTachKhau_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmTachKhau tt = new frmTachKhau();
            tt.MdiParent = this;
            tt.StartPosition = FormStartPosition.CenterScreen;
            tt.Show();

        }

        private void ItemNgoaiXa_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmChuyenDin cdn = new frmChuyenDin();
            cdn.MdiParent = this;
            cdn.StartPosition = FormStartPosition.CenterScreen;
            cdn.Show();

        }

        private void ItemBaoCao_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            frmBaocao bc = new frmBaocao();
            bc.MdiParent = this;
            bc.StartPosition = FormStartPosition.CenterScreen;
            bc.Show();
        }

        private void ItemQuanTri_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmNguoiDung nd = new frmNguoiDung();
            nd.MdiParent = this;
            nd.StartPosition = FormStartPosition.CenterScreen;
            nd.Show();

        }

        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        

        private void ItemSoHoKhau_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmSoHoKhau shk = new frmSoHoKhau();
            shk.MdiParent = this;
            shk.StartPosition = FormStartPosition.CenterScreen;
            shk.Show();

        }

        private void ItemXemNhanKhau_Click(object sender, EventArgs e)
        {
            if (this.MdiChildren.Count() > 0)
                return;
            //Point location = new Point(0, 0);
            frmNhanKhau nk = new frmNhanKhau();
            nk.MdiParent = this;
            nk.StartPosition = FormStartPosition.CenterScreen;
            nk.Show();

        }


    }
}
